package com.gupaoedu.springboot.springbootfrist;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
public class SpringbootFirstApplication extends SpringBootServletInitializer {

//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
//        logger.info("----UpmsServiceApplication 启动----");
//        return application.sources(SpringbootFirstApplication.class);
//
//    }
//
//
//    public static void main(String[] args) {
//        //得到所有SpringBoot的配置类
//        ConfigurableApplicationContext ca =
//            SpringApplication.run(SpringbootFirstApplication.class, args);
//        String[] defClasses = ca.getBeanDefinitionNames();
//        for (String defClass : defClasses) {
//            System.out.println(defClass);
//        }
//    }

    protected final static Logger logger = LoggerFactory.getLogger(SpringbootFirstApplication.class);

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        logger.info("----SpringbootFirstApplication 启动----");
        return application.sources(SpringbootFirstApplication.class);

    }

    public static void main(String[] args) {
        SpringApplication.run(SpringbootFirstApplication.class, args);
        logger.info("----SpringbootFirstApplication 启动----");
    }

}


